<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">

    <h2>颜色列表</h2>
    <ul v-for="temp in color">
        <li @click="al(temp)">{{ temp }}</li>
    </ul>

    <input type="text" @keyup.enter="enter" v-model="inputValue" placeholder="敲击回车出现数值">

</div>
<script src="vue.js"></script>
<script>
    var app = new Vue({
        el:'#app',
        data:{
            color:['red','green','blue','blank'],
            inputValue:'default'
        },
        methods:{
            al:function (e) {
                alert(e);
            },
            enter:function () {
                alert(app.inputValue);
            }
        }
    })
</script>
</body>
</html>